from PyQt5 import QtCore, QtGui, QtWidgets
from ui_mainwindow import Ui_MainWindow
from PyQt5.QtWidgets import QFileDialog

class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setupUi(self)

        self.toolButton_source.clicked.connect(self.tb_select_source)
        self.toolButton_target.clicked.connect(self.tb_select_target)
        self.pushButton_backup.clicked.connect(self.pb_backup)
        self.pushButton_exit.clicked.connect(self.pb_exit)

    def tb_select_source(self):
        print('Select Source')
        directory = QFileDialog.getExistingDirectory()
        print(directory)
        self.lineEdit_source.setText(directory)

    def tb_select_target(self):
        print('Select Target')
        directory = QFileDialog.getExistingDirectory()
        print(directory)
        self.lineEdit_target.setText(directory)

    def pb_backup(self):
        print("Backup")

    def pb_exit(self):
        print('Exit')
